package com.worldcup.service.impl;

import com.worldcup.dao.PredictKnockoutMapper;
import com.worldcup.model.PredictKnockout;
import com.worldcup.service.PredictKnockoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * @author duwan.zq
 * @date 2018/06/02
 */
@Service
public class PredictKnockoutServiceImpl implements PredictKnockoutService {

    @Autowired
    private PredictKnockoutMapper predictKnockoutMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void batchInsert(List<PredictKnockout> knockouts) {
        predictKnockoutMapper.batchInsert(knockouts);
    }

    @Override
    public List<PredictKnockout> getPredictKnockout(String openid) {
        return predictKnockoutMapper.selectByOpenid(openid);
    }

    @Override
    public void delete(String openid) {
        predictKnockoutMapper.deleteByOpenid(openid);
    }
}
